home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / f2c / f2c.h < prev    next >
C/C++ Source or Header  |  1995-04-27  |  4KB  |  216 lines

  1. /* f2c.h  --  Standard Fortran to C header file */
  2.  
  3. /**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
  4.  
  5.     - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
  6.  
  7. #ifndef F2C_INCLUDE
  8. #define F2C_INCLUDE
  9.  
  10. #ifdef _M68881
  11. #include <math-68881.h>
  12. #endif
  13.  
  14. typedef long int integer;
  15. typedef char *address;
  16. typedef short int shortint;
  17. typedef float real;
  18. typedef double doublereal;
  19. typedef struct { real r, i; } complex;
  20. typedef struct { doublereal r, i; } doublecomplex;
  21. typedef long int logical;
  22. typedef short int shortlogical;
  23.  
  24. #define TRUE_ (1)
  25. #define FALSE_ (0)
  26.  
  27. /* Extern is for use with -E */
  28. #ifndef Extern
  29. #define Extern extern
  30. #endif
  31.  
  32. /* I/O stuff */
  33.  
  34. #ifdef f2c_i2
  35. /* for -i2 */
  36. typedef short flag;
  37. typedef short ftnlen;
  38. typedef short ftnint;
  39. #else
  40. typedef long flag;
  41. typedef long ftnlen;
  42. typedef long ftnint;
  43. #endif
  44.  
  45. /*external read, write*/
  46. typedef struct
  47. {    flag cierr;
  48.     ftnint ciunit;
  49.     flag ciend;
  50.     char *cifmt;
  51.     ftnint cirec;
  52. } cilist;
  53.  
  54. /*internal read, write*/
  55. typedef struct
  56. {    flag icierr;
  57.     char *iciunit;
  58.     flag iciend;
  59.     char *icifmt;
  60.     ftnint icirlen;
  61.     ftnint icirnum;
  62. } icilist;
  63.  
  64. /*open*/
  65. typedef struct
  66. {    flag oerr;
  67.     ftnint ounit;
  68.     char *ofnm;
  69.     ftnlen ofnmlen;
  70.     char *osta;
  71.     char *oacc;
  72.     char *ofm;
  73.     ftnint orl;
  74.     char *oblnk;
  75. } olist;
  76.  
  77. /*close*/
  78. typedef struct
  79. {    flag cerr;
  80.     ftnint cunit;
  81.     char *csta;
  82. } cllist;
  83.  
  84. /*rewind, backspace, endfile*/
  85. typedef struct
  86. {    flag aerr;
  87.     ftnint aunit;
  88. } alist;
  89.  
  90. /* inquire */
  91. typedef struct
  92. {    flag inerr;
  93.     ftnint inunit;
  94.     char *infile;
  95.     ftnlen infilen;
  96.     ftnint    *inex;    /*parameters in standard's order*/
  97.     ftnint    *inopen;
  98.     ftnint    *innum;
  99.     ftnint    *innamed;
  100.     char    *inname;
  101.     ftnlen    innamlen;
  102.     char    *inacc;
  103.     ftnlen    inacclen;
  104.     char    *inseq;
  105.     ftnlen    inseqlen;
  106.     char     *indir;
  107.     ftnlen    indirlen;
  108.     char    *infmt;
  109.     ftnlen    infmtlen;
  110.     char    *inform;
  111.     ftnint    informlen;
  112.     char    *inunf;
  113.     ftnlen    inunflen;
  114.     ftnint    *inrecl;
  115.     ftnint    *innrec;
  116.     char    *inblank;
  117.     ftnlen    inblanklen;
  118. } inlist;
  119.  
  120. #define VOID void
  121.  
  122. union Multitype {    /* for multiple entry points */
  123.     shortint h;
  124.     integer i;
  125.     real r;
  126.     doublereal d;
  127.     complex c;
  128.     doublecomplex z;
  129.     };
  130.  
  131. typedef union Multitype Multitype;
  132.  
  133. typedef long Long;    /* No longer used; formerly in Namelist */
  134.  
  135. struct Vardesc {    /* for Namelist */
  136.     char *name;
  137.     char *addr;
  138.     ftnlen *dims;
  139.     int  type;
  140.     };
  141. typedef struct Vardesc Vardesc;
  142.  
  143. struct Namelist {
  144.     char *name;
  145.     Vardesc **vars;
  146.     int nvars;
  147.     };
  148. typedef struct Namelist Namelist;
  149.  
  150. #define abs(x) ((x) >= 0 ? (x) : -(x))
  151. #define dabs(x) (doublereal)abs(x)
  152. #define min(a,b) ((a) <= (b) ? (a) : (b))
  153. #define max(a,b) ((a) >= (b) ? (a) : (b))
  154. #define dmin(a,b) (doublereal)min(a,b)
  155. #define dmax(a,b) (doublereal)max(a,b)
  156.  
  157. /* procedure parameter types for -A and -C++ */
  158.  
  159. #define F2C_proc_par_types 1
  160. #ifdef __cplusplus
  161. typedef int /* Unknown procedure type */ (*U_fp)(...);
  162. typedef shortint (*J_fp)(...);
  163. typedef integer (*I_fp)(...);
  164. typedef real (*R_fp)(...);
  165. typedef doublereal (*D_fp)(...), (*E_fp)(...);
  166. typedef /* Complex */ VOID (*C_fp)(...);
  167. typedef /* Double Complex */ VOID (*Z_fp)(...);
  168. typedef logical (*L_fp)(...);
  169. typedef shortlogical (*K_fp)(...);
  170. typedef /* Character */ VOID (*H_fp)(...);
  171. typedef /* Subroutine */ int (*S_fp)(...);
  172. #else
  173. typedef int /* Unknown procedure type */ (*U_fp)();
  174. typedef shortint (*J_fp)();
  175. typedef integer (*I_fp)();
  176. typedef real (*R_fp)();
  177. typedef doublereal (*D_fp)(), (*E_fp)();
  178. typedef /* Complex */ VOID (*C_fp)();
  179. typedef /* Double Complex */ VOID (*Z_fp)();
  180. typedef logical (*L_fp)();
  181. typedef shortlogical (*K_fp)();
  182. typedef /* Character */ VOID (*H_fp)();
  183. typedef /* Subroutine */ int (*S_fp)();
  184. #endif
  185. /* E_fp is for real functions when -R is not specified */
  186. typedef VOID C_f;    /* complex function */
  187. typedef VOID H_f;    /* character function */
  188. typedef VOID Z_f;    /* double complex function */
  189. typedef doublereal E_f;    /* real function with -R not specified */
  190.  
  191. /* undef any lower-case symbols that your C compiler predefines, e.g.: */
  192.  
  193. #ifndef Skip_f2c_Undefs
  194. #undef cray
  195. #undef gcos
  196. #undef mc68k
  197. #undef mc68010
  198. #undef mc68020
  199. #undef mips
  200. #undef pdp11
  201. #undef sgi
  202. #undef sparc
  203. #undef sun
  204. #undef sun2
  205. #undef sun3
  206. #undef sun4
  207. #undef u370
  208. #undef u3b
  209. #undef u3b2
  210. #undef u3b5
  211. #undef unix
  212. #undef vax
  213. #undef gem
  214. #endif
  215. #endif
  216.